//package com.icangya.admin;
//
//import com.alibaba.fastjson.JSONArray;
//import com.alibaba.fastjson.JSONObject;
//import com.icangya.Utils.JSONUtils;
//import com.icangya.domain.FbMissionAward;
//import com.icangya.service.IMissionService;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@CrossOrigin
//@RestController
//@RequestMapping(value = "/admin/adminMission")
//public class MissionController {
//
//    private Logger logger = LoggerFactory.getLogger(this.getClass());
//
//    @Autowired
//    private IMissionService iMissionService;
//
//
//
////获取奖励信息
////    @RequestMapping(value = "getMissionAward",method =RequestMethod.GET)
////    public JSONObject getMissionAward(){
////        List<FbMissionAward> list=iMissionService.getFbMissionAward();
////        if(list.size()>0){
////            JSONArray jsonArray=new JSONArray();
////            for (FbMissionAward missionAward: list) {
////
////                JSONObject jsonObject=new JSONObject();
////                jsonObject.put("id",missionAward.getId());
////                jsonObject.put("awardId",missionAward.getAwardId());
////                jsonObject.put("awardContent",missionAward.getAwardMoney());
////                jsonObject.put("status",missionAward.getStatus());//领取的状态
////                jsonObject.put("site",missionAward.getSite());//场次
////                jsonArray.add(jsonObject);
////            }
////            return JSONUtils.getRoot(0,"success",jsonArray);
////        }
////        return JSONUtils.getRoot(1,"faild","");
////    }
//
//    //获取某一下注金额的奖励信息
//    @RequestMapping(value = "getMissionAwardBySite",method =RequestMethod.GET)
//    public JSONObject getMissionAwardBySite(@RequestParam int site){
//        if(site<2  || site>20){
//            return JSONUtils.getRoot(1,"faild","参数有误");
//        }
//
//        List<FbMissionAward> list=iMissionService.getMissionAwardByStatus(site);
//        if(list.size()>0){
//            JSONArray jsonArray=new JSONArray();
//            for (FbMissionAward missionAward: list) {
//
//                JSONObject jsonObject=new JSONObject();
//                jsonObject.put("id",missionAward.getId());
//                jsonObject.put("awardId",missionAward.getAwardId());
//                jsonObject.put("awardContent",missionAward.getAwardMoney());
//                jsonObject.put("status",missionAward.getStatus());//领取的状态
//                jsonObject.put("site",missionAward.getSite());//场次
//                jsonArray.add(jsonObject);
//            }
//            return JSONUtils.getRoot(0,"success",jsonArray);
//        }
//        return JSONUtils.getRoot(1,"faild","");
//    }
//
//    //设置可领取的奖励信息
//    @RequestMapping(value = "updateMissionAward",method =RequestMethod.GET)
//    public JSONObject updateMissionAward(@RequestParam long awardId){
//
//        if ("".equals(awardId) || awardId <= 0) {
//            return JSONUtils.getRoot(1,"faild","参数有误");
//        }
//        FbMissionAward fbMissionAward=   iMissionService.getMissionAward(awardId);
//        if(fbMissionAward!=null){
//            if(fbMissionAward.getStatus()==1){
//                fbMissionAward.setStatus(0);
//            }else{
//                fbMissionAward.setStatus(1);
//            }
//            boolean bool= iMissionService.updateMissionAward(fbMissionAward);
//            if(bool){
//                return JSONUtils.getRoot(0,"success","修改成功");
//            }
//        }
//        return JSONUtils.getRoot(1,"faild",null);
//    }
//
//    //查询用户所有的转盘记录
//    @RequestMapping(value = "getTurntableRecordByOpenId",method =RequestMethod.GET)
//    public  JSONObject getTurntableRecordByOpenId(@RequestParam String openId,@RequestParam int startPage){
//        if ("".equals(openId) || openId == null || startPage<1) {
//            return JSONUtils.getRoot(1,"faild","参数有误");
//        }
//        List list= iMissionService.getTurntableRecordByOpenId(openId,startPage);
//
//        if(list!=null){
//            JSONObject jsonObject=new JSONObject();
//            jsonObject.put("value",list.get(0));
//            jsonObject.put("totalPage",list.get(1));
//            jsonObject.put("inPage",list.get(2));
//            return JSONUtils.getRoot(0,"success",jsonObject);
//        }
//        return JSONUtils.getRoot(1,"faild",null);
//    }
//
//
//}
//
//
//
//
//
//
//
//
//
//
//
//
